<template>
	<view class="p-24 pbgBox">
		<view class="textC font-32 font-weight">{{detali.name||'标题'}}</view>
		<view class="textC grey m-t-10 m-b-30">{{$util.timeStampTurnTime(detali.updatetime) ||''}}</view>
		<view style="white-space: pre-wrap;" v-html="detali.content"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				detali: {},
				id: ''
			};
		},
		onLoad(res) {
			console.log(res);
			this.id = res.id
			this.browseNotice(res.id)
			this.notice()
		},
		methods: {
			browseNotice(id) {
				this.$api.sendRequest({
					url:'/api/index/browseNotice',
					data:{
						id:id
					}
				})
			},
			notice() {
				this.$api.sendRequest({
					url: '/api/index/notice',
					success: res => {
						res.data.forEach(item => {
							if (item.id == this.id) {
								this.detali = item
							}
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.pbgBox {
		background-color: #fff;
		border-radius: 20rpx;
		overflow-x: auto;
		white-space: pre-wrap;
	}
</style>
